﻿@model Senparc.Weixin.MP.AdvancedAPIs.OAuth.OAuthUserInfo
@{
    ViewBag.Title = "个人资料";
    Layout = "~/Views/Shared/_WxLayout.cshtml";
}
头像：<img style="width:100px; height: 100px;border-radius:50px" src="@Model.headimgurl"/>
<br />
昵称：@Model.nickname
<br />
地区： @Model.province @Model.city
<br/>
手机号：<input id="phone" name="phone"/>
<br/>
生日：<input id="birthDate" name="birthDate" type="date" />
<br />
<button id="btn_save">保存</button>
@section Js{
    <script type="text/javascript">
        $(function() {
            var isAjax = false;
            $("#btn_save").click(function() {
                if (isAjax) {
                    return;
                }
                isAjax = true;
                var parms = {
                    phone: $("#phone").val(),
                    birthDate: $("#birthDate").val()
                }
                $.post("/WeiXin/UserSave", parms, function(json) {
                    isAjax = false;
                    //提示
                    layer.open({
                        content: !json.msg ? '操作成功' : json.msg,
                        skin: 'msg',
                        time: 2, //2秒后自动关闭
                        end: function() {
                            location.href = '/WeiXin/UserInfo';
                        }
                    });

                });
            });
        });
    </script>
}
